package acme.entity;

import java.util.Calendar;
import java.util.Date;
import java.util.Random;

public class Order implements Entity{
	
	private String orderId = null;
	private String orderDate = null;
	private String status = "Complete";
	private String shiptoAddress = null;
	private String orderItemId1 = null;
	private String orderItemQty1 = null;
	private String orderItemId2 = null;
	private String orderItemQty2 = null;
	
	private static Random random = new Random();
	
	public Order(String shiptoAddress, String orderItemId1, String orderItemQty1, 
			String orderItemId2, String orderItemQty2) {
		this.shiptoAddress = shiptoAddress;
		this.orderItemId1 = orderItemId1;
		this.orderItemQty1 = orderItemQty1;
		this.orderItemId2 = orderItemId2;
		this.orderItemQty2 = orderItemQty2;
		this.getId();
		this.getOrderDate();
	}
	
	public Order(){}

	@Override
	public String getId() {
		orderId = Math.abs(random.nextInt()) + "";
		return orderId;
	}

	@Override
	public String getUrl() {
		return null;
	}
	
	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getOrderDate() {
		Date d = new Date();
		this.orderDate = d.toGMTString();
		return orderDate;
	}

	public void setOrderDate(String orderDate) {
		this.orderDate = orderDate;
	}

	public String getShiptoAddress() {
		return shiptoAddress;
	}

	public void setShiptoAddress(String shiptoAddress) {
		this.shiptoAddress = shiptoAddress;
	}

	public String getOrderItemId1() {
		return orderItemId1;
	}

	public void setOrderItemId1(String orderItemId1) {
		this.orderItemId1 = orderItemId1;
	}

	public String getOrderItemQty1() {
		return orderItemQty1;
	}

	public void setOrderItemQty1(String orderItemQty1) {
		this.orderItemQty1 = orderItemQty1;
	}

	public String getOrderItemId2() {
		return orderItemId2;
	}

	public void setOrderItemId2(String orderItemId2) {
		this.orderItemId2 = orderItemId2;
	}

	public String getOrderItemQty2() {
		return orderItemQty2;
	}

	public void setOrderItemQty2(String orderItemQty2) {
		this.orderItemQty2 = orderItemQty2;
	}
	
}
